class TreeResp {
  List<TreeGroup> _data;
  int _errorCode;
  String _errorMsg;

  List<TreeGroup> get data => _data;

  int get errorCode => _errorCode;

  String get errorMsg => _errorMsg;

  TreeResp({List<TreeGroup> data, int errorCode, String errorMsg}) {
    _data = data;
    _errorCode = errorCode;
    _errorMsg = errorMsg;
  }

  TreeResp.fromJson(dynamic json) {
    if (json["data"] != null) {
      _data = [];
      json["data"].forEach((v) {
        _data.add(TreeGroup.fromJson(v));
      });
    }
    _errorCode = json["errorCode"];
    _errorMsg = json["errorMsg"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_data != null) {
      map["data"] = _data.map((v) => v.toJson()).toList();
    }
    map["errorCode"] = _errorCode;
    map["errorMsg"] = _errorMsg;
    return map;
  }
}

class TreeGroup {
  List<Children> _children;
  int _id;
  String _name;

  List<Children> get children => _children;

  int get id => _id;

  String get name => _name;

  TreeGroup({List<Children> children, int id, String name}) {
    _children = children;
    _id = id;
    _name = name;
  }

  TreeGroup.fromJson(dynamic json) {
    if (json["children"] != null) {
      _children = [];
      json["children"].forEach((v) {
        _children.add(Children.fromJson(v));
      });
    }
    _id = json["id"];
    _name = json["name"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_children != null) {
      map["children"] = _children.map((v) => v.toJson()).toList();
    }
    map["id"] = _id;
    map["name"] = _name;
    return map;
  }
}

class Children {
  int _id;
  String _name;

  int get id => _id;

  String get name => _name;

  Children({int id, String name}) {
    _id = id;
    _name = name;
  }

  Children.fromJson(dynamic json) {
    _id = json["id"];
    _name = json["name"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["name"] = _name;
    return map;
  }
}
